package own.zch.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.cndym.utils.Md5;

public class CreateMD5UtilNew {

	public static String getMd5ByMap(Map<String,String> paraMap){
		String sid = paraMap.get("sid");
//		ICooperationService cooperationService = (ICooperationService) SpringUtils
//				.getBean("cooperationServiceImpl");
//		
//		Cooperation cooperation = 
//				cooperationService.getCooperationBySid(sid);

		List<String> tempList = new ArrayList<String>();
		for (Map.Entry<String, String> entry : paraMap.entrySet()) {
			tempList.add(entry.getKey());
		}
		java.util.Collections.sort(tempList);
		StringBuilder md5Str = new StringBuilder();
		for (String s : tempList) {
			if ("md5".equals(s) || "func".equals(s) || "ip".equals(s)
					|| "source".equals(s)) {
				continue;
			}
			md5Str.append(paraMap.get(s));
		}
		md5Str.append("kkdYJjaMBSqEp6NLepGTxz2uyHn5FJxMCdGe7iAlJZWzSuvBt995uRARe2rbi8V7"); // 8001鐨勭閽�
		String currMd5 = Md5.Md5(md5Str.toString());
		return currMd5;
	}
}
